package com.woniuxy.rabbitMq.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectConfig {
    @Bean
    public DirectExchange directExchangeA(){
        return new DirectExchange("directExchangeA");
    }
    @Bean
    public Queue directQueueA(){
        return new Queue("directQueueA");
    }
    @Bean
    public DirectExchange directExchangeB(){
        return new DirectExchange("directExchangeB");
    }
    @Bean
    public Queue directQueueB(){
        return new Queue("directQueueB");
    }

    @Bean
    public Binding binding11(){
        return BindingBuilder.bind(directQueueA()).to(directExchangeA()).with("AAA");
    }
    @Bean
    public Binding binding12(){
        return BindingBuilder.bind(directQueueB()).to(directExchangeB()).with("BBB");
    }
    @Bean
    public Binding binding13(){
        return BindingBuilder.bind(directQueueB()).to(directExchangeB()).with("B1B1");
    }
    @Bean
    public Binding binding14(){
        return BindingBuilder.bind(directQueueB()).to(directExchangeB()).with("B2B2");
    }
}
